package com.backend.repository;

import com.backend.entity.Session;
import com.backend.entity.SessionMovie;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface SessopnMovieRepository  extends JpaRepository<SessionMovie, Integer> {
    @Query(value = "select * from session, cinema where cinema_id = cinema.id and movie_id = ?1", nativeQuery = true)
    public List<SessionMovie> findByMovie_id(@Param("movie_id") Integer movie_id);
}
